local ads__cuohe = fk.CreateSkill {
  name = "ads__cuohe",
}

ads__cuohe:addEffect("active", {
  anim_type = "supportive",
  prompt = "#cuohe-active",
  max_phase_use_time = 1,
  card_num = 0,
  target_num = 2,
  target_filter = function(self, player, to_select, selected)
    if #selected < 2 and to_select:isFemale() then
      if #selected == 0 then
        return true
      else
        return to_select:canUseTo(Fk:cloneCard("ex_nihilo"), selected[1])
      end
    end
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    room:drawCards(player, 1, ads__cuohe.name)
    local ex_nihilo = Fk:cloneCard("ex_nihilo")
    ex_nihilo.skillName = ads__cuohe.name
    local new_use = { ---@type UseCardDataSpec
      from = effect.tos[1],
      tos = { effect.tos[2] },
      card = ex_nihilo,
      prohibitedCardNames = { "nullification" },
    }
    room:useCard(new_use)
  end,
  target_tip = function(self, _, to_select, selected, _, _, selectable, _)
    if not selectable then return end
    if #selected == 0 or (#selected > 0 and selected[1] == to_select) then
      return "cuohe_tip_1"
    else
      return "cuohe_tip_2"
    end
  end,
})


Fk:loadTranslationTable{
  ["$ads__cuohe1"] = "嗯呵呵～～呵呵～～",
  ["$ads__cuohe2"] = "夫人，你要替妾身作主啊……",
  ["ads__cuohe"] = "撮合",
  [":ads__cuohe"] = "出牌阶段限一次，你可以摸一张牌并选择两名女性角色，先选择的角色视为对后选择的角色使用了一张不能被【无懈可击】的【无中生有】。",
  ["#cuohe-active"] = "发动 撮合，摸一张牌并选择两名女性角色，先选择的角色视为对后选择的角色使用了一张不能被【无懈可击】的【无中生有】",
  ["cuohe_tip_1"] = "先摸牌",
  ["cuohe_tip_2"] = "后摸牌",

}

return ads__cuohe
